var datagrid; //定义全局变量datagrid
var editRow = undefined; //定义全局变量：当前编辑的行
$(function(){
    //加载部门树
   // queryDepartmentTree();
    //加载数据字典下拉列表
    //queryDictionaryList("",CONSTANT.DictionaryTypeDefConstants.HD_HD_PROGERSSNODE);//隐患治理进度节点
    //年度下拉列表
    //queryYearthList('yearth');
    //queryMonthList('month');
    /**
     * 加载隐患治理列表
     * @type {jQuery}
     */
   var monthReportId = $("#monthReportId").val();
    datagrid = $("#hdGovernList").datagrid({
        //data:datagridData,
        url: ROOT_PATH+'/hiddenDanger/hdGovern/queryEditPageHDGovernList.shtml?monthReportId='+monthReportId, //请求的数据源
        iconCls: 'icon-save', //图标
        pagination: true, //显示分页
        pageSize: 10, //页大小
        pageList: [10, 15, 20], //页大小下拉选项此项各value是pageSize的倍数
        rownumbers:true,
        singleSelect:true,
        fit: true, //datagrid自适应宽度
        //fitColumns: true, //列自适应宽度
        striped: true, //行背景交换
        nowap: true, //列内容多时自动折至第二行
        //border: false,
        //toolbar:'#tb',
        idField: 'id', //主键
        columns: [[//显示的列
            {field:'id',width:100,checkbox:true},
            //{field:'dutyUserId',width:100,hidden:true},
           /* {field:'id',title:'隐患id',width:100},*/
            {field:'hdName',title:'隐患名称',width:100},
            {field:'deptName',title:'隐患所在单位',width:100},
            {field:'dutyDeptName',title:'项目责任单位',width:100},
            {field:'hdGradeName',title:'隐患等级',width:100},
            {field:'addDeptName',title:'登记部门',width:100},
            {field:'addUserName',title:'登记人',width:100},
            {field:'planFinishTime',title:'计划完成时间',width:130},
            {field:'governId',width:100,hidden:true},
            {field:'actualFinishTime',title:'实际完成时间',width:130},
            {field:'governContent',title:'治理内容',width:300
            },
            {field:'specificProgress',title:'具体形象进度',width:300},
            {field:'progressNodeName',title:'进度节点名称',width:150,hidden:true},
            {field:'progressNodeId',title:'进度节点',width:150,
                formatter:function(value,row,index){
                if(row.progressNodeName){
                    return row.progressNodeName;
                }
                }},
            {field:'monthInvest',title:'本月完成投资(万元)',width:150},
            {field:'allInvest',title:'累计已完成投资',width:150},
            {field:'isMonth',title:'是否月报',width:150}
        ]],
        queryParams: {
            //action: 'query'
        } //查询参数

    });




});


